package com.atchangsha.system.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atchangsha.system.common.utils.PageUtils;
import com.atchangsha.system.common.utils.Query;
import com.atchangsha.system.dao.MenusOrderRelationDao;
import com.atchangsha.system.entity.MenusOrderRelationEntity;
import com.atchangsha.system.service.MenusOrderRelationService;

@Service("menusOrderRelationService")
public class MenusOrderRelationServiceImpl extends ServiceImpl<MenusOrderRelationDao, MenusOrderRelationEntity> implements MenusOrderRelationService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<MenusOrderRelationEntity> page = this.page(
                new Query<MenusOrderRelationEntity>().getPage(params),
                new QueryWrapper<MenusOrderRelationEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<MenusOrderRelationEntity> selectEntityById(Long id) {
        List<MenusOrderRelationEntity> entities = baseMapper.selectList(new QueryWrapper<MenusOrderRelationEntity>().eq("order_id", id));
        return entities;
    }

}